Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@aws-crypto/raw-aes-keyring-node
Advanced tools
The AWS Encryption SDK for JavaScript is a client-side encryption library designed to make it easy for everyone to encrypt and decrypt data using industry standards and best practices. It uses a data format compatible with the AWS Encryption SDKs in other
@aws-crypto/raw-aes-keyring-node is an npm package provided by AWS that allows you to use raw AES keyrings for client-side encryption and decryption in Node.js applications. It is part of the AWS Encryption SDK, which provides tools for encrypting and decrypting data securely.
Encrypting Data
This code sample demonstrates how to use the @aws-crypto/raw-aes-keyring-node package to encrypt data. It creates a RawAesKeyringNode with a specified key and uses it to encrypt a plaintext message.
const { RawAesKeyringNode, encrypt } = require('@aws-crypto/client-node');
const { KeyringNode } = require('@aws-crypto/raw-aes-keyring-node');
const keyName = 'example-key';
const keyNamespace = 'example-namespace';
const unencryptedMasterKey = Buffer.from('00112233445566778899aabbccddeeff', 'hex');
const keyring = new RawAesKeyringNode({
keyName,
keyNamespace,
unencryptedMasterKey
});
const plaintext = Buffer.from('Hello, world!');
(async () => {
const { result } = await encrypt(keyring, plaintext);
console.log(result); // Encrypted data
})();
Decrypting Data
This code sample demonstrates how to use the @aws-crypto/raw-aes-keyring-node package to decrypt data. It creates a RawAesKeyringNode with a specified key and uses it to decrypt an encrypted message.
const { RawAesKeyringNode, decrypt } = require('@aws-crypto/client-node');
const { KeyringNode } = require('@aws-crypto/raw-aes-keyring-node');
const keyName = 'example-key';
const keyNamespace = 'example-namespace';
const unencryptedMasterKey = Buffer.from('00112233445566778899aabbccddeeff', 'hex');
const keyring = new RawAesKeyringNode({
keyName,
keyNamespace,
unencryptedMasterKey
});
const encryptedData = Buffer.from('...'); // Replace with your encrypted data
(async () => {
const { plaintext } = await decrypt(keyring, encryptedData);
console.log(plaintext.toString()); // Decrypted data
})();
The built-in 'crypto' module in Node.js provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. While it is not as high-level as @aws-crypto/raw-aes-keyring-node, it provides the fundamental tools needed for encryption and decryption.
node-forge is a JavaScript library that provides a native implementation of TLS (and various other cryptographic tools) in Node.js. It offers more flexibility and lower-level control compared to @aws-crypto/raw-aes-keyring-node, but requires more effort to implement secure encryption and decryption workflows.
Stanford Javascript Crypto Library (SJCL) is a library for cryptography in JavaScript. It is designed to be fast, small, and easy to use. While it is more lightweight compared to @aws-crypto/raw-aes-keyring-node, it does not provide the same level of integration with AWS services.
The AWS Encryption SDK for JavaScript is a client-side encryption library designed to make it easy for everyone to encrypt and decrypt data using industry standards and best practices. It uses a data format compatible with the AWS Encryption SDKs in other languages. For more information on the AWS Encryption SDKs in all languages, see the Developer Guide.
This package should only be used as part of the AWS Encryption SDK for Javascript. For more information about the packages in this project and how they can be used together, see the main node package readme
npm install @aws-crypto/raw-aes-keyring-node
npm test
This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.
FAQs
The AWS Encryption SDK for JavaScript is a client-side encryption library designed to make it easy for everyone to encrypt and decrypt data using industry standards and best practices. It uses a data format compatible with the AWS Encryption SDKs in other
The npm package @aws-crypto/raw-aes-keyring-node receives a total of 178,448 weekly downloads. As such, @aws-crypto/raw-aes-keyring-node popularity was classified as popular.
We found that @aws-crypto/raw-aes-keyring-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.